package com.power.sifa.approve.model.enumeration;

import lombok.Getter;
import lombok.val;

/**
 * 行政行为类型常量类
 */
@Getter
public enum Tp_admpr {

    A(6003901, "a", "行政处罚"),
    B(6003902, "b", "行政强制"),
    C(6003903, "c", "行政征收"),
    D(6003904, "d", "行政许可"),
    E(6003905, "e", "行政确权"),
    F(6003906, "f", "行政确认"),
    G(6003907, "g", "信息公开"),
    H(6003908, "h", "举报投诉处理"),
    I(6003909, "i", "行政审批"),
    J(6003910, "J", "行政不作为"),
    OTHER(6003900, "other", "其他");

    private Integer key;
    private String name;
    private String description;


    Tp_admpr(Integer key, String name, String description) {
        this.key = key;
        this.name = name;
        this.description = description;
    }

    public static String getDescriptionByKey (Integer key) {
        Tp_admpr[] materialEnums = Tp_admpr.values();
        for (Tp_admpr materialEnum : materialEnums) {
            if (materialEnum.key.equals(key)) {
                return materialEnum.getDescription();
            }
        }
        return null;
    }

    public static Tp_admpr getByKey (Integer key) {
        Tp_admpr[] materialEnums = Tp_admpr.values();
        for (Tp_admpr materialEnum : materialEnums) {
            if (materialEnum.key.equals(key)) {
                return materialEnum;
            }
        }
        return null;
    }


}
